package com.myapp.struts.menu;

import java.util.ArrayList;

public class GBDinnerXML {

    private static GBDinnerXML gbDinnerXMLObj;
    ArrayList<FoodItems> gbDinnerXMLArray = new ArrayList<FoodItems>();

    public static synchronized GBDinnerXML getSingletonObject() {
        if (gbDinnerXMLObj == null) {
            gbDinnerXMLObj = new GBDinnerXML();
        }
        return gbDinnerXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getGBDinnerXML(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        gbDinnerXMLArray = menuReadObj.ReadMenu(Constants.GREAT_BRITAN);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        gbDinnerXMLArray = menuGenerateObj.GenerateMenu(gbDinnerXMLArray, Constants.DINNER);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(gbDinnerXMLArray, Constants.XML, fileLoc);
        return fileName;

    }
}
